<template>
	<view class="notice-wrap bg-white" v-if="showList">
		<view class="title text-center bold">
			{{noticeData.title}}
		</view>
		<view class="header flex-x-end">
			<text>{{noticeData.update_time ? noticeData.update_time : noticeData.create_time}}</text>
		</view>
		<view class="content">
			<rich-text class="inline-block w100" :nodes="noticeData.desc"></rich-text>
		</view>
	</view>
</template>

<script>
	import {
		getNotice
	} from '../apis/public/index.js'

	export default {
		data() {
			return {
				noticeData: {},
				showList:false
			}
		},
		onLoad(option) {
			// uni.showLoading({
			// 	title: '加载中...',
			// 	mask: false
			// });
			this.getNoticeData(option.noticeId)
		},
		methods: {
			getNoticeData(ids) {
				getNotice({
					ids
				}).then(res => {
					res.data.detail.desc = res.data.detail.desc.replace(/\<img/gi, '<img class="rich-img"')
					this.noticeData = res.data.detail
					this.showList=true;
					// uni.hideLoading();
				})
			}
		}
	}
</script>

<style lang="less">
	
	.notice-wrap {
		padding: 28rpx;
		box-sizing: border-box;

		.title {
			font-size: 50rpx;
		}

		.header {
			margin-top: 30rpx;
			font-size: 24rpx;
			color: #6C6C6C;
		}

		.content {
			margin-top: 50rpx;
			font-size: 34rpx;
			.rich-img {
				width: 100% !important;
				height: auto;
			}
		}
	}
</style>
